home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
CADAR
/
Symbols
/
Other
/
split-to-parts
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-22
|
1KB
|
45 lines
split-to-parts
name symbol-list &rest length-lists
this function is the same as MRAC m-consecutive
that is a melody-line is split to several parts.
this way you can get a melody line to cross between
instruments
when to or more rhythms occur on the same beat it
always selects in order top->down
(split-to-parts nil '(a b c d e)
'(1/8 1/4 1/4 1/4 1/8)
'(1/4 1/2 1/8 1/8))
->((a c e a c) (b d b d))
it is easiest to view the result in a scoreprogram.
(split-to-parts nil '(a b c d e)
'(1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8)
'(1/16 1/16 1/16 1/16 1/1)
'(1/4 1/2 1/8 1/8)
'(1/12 1/12 1/12 1/1 1/4 1/8))
->((a b a e a b c e) (b e c e b) (c c d a) (d a d d b c))
when name is not nil binds result to name with setq.
it evaluates so the material is ready to use.
(split-to-parts 'rhy '(a b c d e)
'(1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8)
'(1/16 1/16 1/16 1/16 1/1)
'(1/4 1/2 1/8 1/8)
'(1/12 1/12 1/12 1/1 1/4 1/8))
-> prints:
(setq rhy1 '(a b a e a b c e))
(setq rhy2 '(b e c e b))
(setq rhy3 '(c c d a))
(setq rhy4 '(d a d d b c))
and without evaluating now rhy1 is '(a b a e a b c e)
and so on.
see also its counter-function split-to-unison